package com.xyoto.community.entity.main;

import com.xyoto.community.constant.ReadStatus;
import com.xyoto.community.utils.handler.CreateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 私信实体类
 */
@ApiModel("私信实体类")
@Data
public class PrivateLetter {
    @ApiModelProperty("主键id")
    private Integer id;

    @ApiModelProperty("发送人id")
    private Integer userId;

    @ApiModelProperty("目标用户id")
    private Integer targetUserId;

    @ApiModelProperty("私信内容")
    private String content;

    @ApiModelProperty("图片路径")
    private String path;

    @ApiModelProperty("阅读状态，1未读，2已读")
    private Short readStatus;


    @ApiModelProperty("创建时间")
    @CreateTime
    private Date createTime;

    public PrivateLetter() {
        this.readStatus = ReadStatus.UNREAD;
    }

    /**
     *
     * @param userId 发送人id
     * @param targetUserId 接收人id
     */
    public PrivateLetter(Integer userId, Integer targetUserId) {
        this();
        this.userId = userId;
        this.targetUserId = targetUserId;
    }

}
